home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / riscscript / !RiScript / System / Utils < prev   
Text File  |  1994-09-04  |  1KB  |  47 lines

  1. %
  2. % --- RiScript Utils (27/01/94) ---
  3. %
  4.  
  5. userdict begin
  6.  
  7. % --- generating errors from PostScript programs
  8. % --- usage: /errorname raise
  9. /raise {
  10.   //errordict exch get
  11.   countexecstack array execstack dup length 2 sub get exch exec
  12. } def
  13.  
  14. % --- function to time PostScript procedures 
  15. % --- usage: { .... } time
  16. /time {usertime exch exec usertime exch sub 1e3 div = (\n) print} def
  17.  
  18. % --- miscellaneous functions ---
  19. /cls   {(\f) print flush} def
  20. /cand  {exch {exec}{pop false} ifelse} def
  21. /cor   {exch {pop true}{exec} ifelse} def
  22. /pdict {{exch == ( => ) print == (\n) print} forall flush} def 
  23. /!run  {gsave {run} stopped grestore {stop} if} def
  24. /pvm   {vmstatus 
  25.         (%%[VM: max=) print = 
  26.         (; used=) print = 
  27.         (; level=) print = 
  28.         (]%%\n) print flush} def
  29. /ppath {{exch = ( ) print = ( moveto ) print flush}
  30.         {exch = ( ) print = ( lineto ) print flush}
  31.         {6 -2 roll exch = ( ) print = ( ) print
  32.          4 -2 roll exch = ( ) print = ( ) print 
  33.                    exch = ( ) print = ( curveto ) print flush}
  34.         {(closepath ) print flush} pathforall} def
  35. /filename 100 string def
  36. /ls    {{= (\n) print} //filename filenameforall flush} def
  37. currentdict /filename undef
  38.  
  39. % --- define store as it should be ---
  40. /store {
  41.   exch dup
  42.   where {} {currentdict} ifelse
  43.   exch 3 -1 roll put
  44. } def
  45.  
  46. end % userdict
  47.